var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = cc._decorator,
    s = r.ccclass,
    c = r.property,
    p = (function (t) {
        i(e, t);
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            e.dH = 0;
            e.dS = 0;
            e.dL = 0;
            return e;
        }
        e.prototype.onLoad = function () {
            this.checkView();
            this.applyHue();
            this.applySaturation();
            this.applyLightness();
        };
        e.prototype.checkView = function () {
            null == this.sprite && (this.sprite = this.node.getComponent(cc.Sprite));
            this.material || (this.material = this.sprite.getMaterial(0));
        };
        e.prototype.applyHue = function () {
            this.setHue(this.dH);
        };
        e.prototype.applySaturation = function () {
            this.setSaturation(this.dS);
        };
        e.prototype.applyLightness = function () {
            this.setLightness(this.dL);
        };
        e.prototype.setHue = function (t) {
            this.material.setProperty("u_dH", t);
        };
        e.prototype.setSaturation = function (t) {
            this.material.setProperty("u_dS", t);
        };
        e.prototype.setLightness = function (t) {
            this.material.setProperty("u_dL", t);
        };
        e.prototype.callbackH = function (t) {
            this.setHue(Number(360 * t.progress));
        };
        e.prototype.callbackS = function (t) {
            this.setSaturation(Number(t.progress));
        };
        e.prototype.callbackL = function (t) {
            this.setLightness(Number(t.progress));
        };
        n([c({range: [-180, 180], slide: !0})], e.prototype, "dH", void 0);
        n([c({range: [-1, 1], slide: !0})], e.prototype, "dS", void 0);
        n([c({range: [-1, 1], slide: !0})], e.prototype, "dL", void 0);
        return n([s], e);
    })(cc.Component);
o.default = p;
